import sqlite3
import math

if __name__ == '__main__':
    table_name = 'pidata'
    conn = sqlite3.connect('D:\\project\\C++\\PIInterface\\bin\\sqlite3\\pidata.sqlite3')
    c = conn.cursor()
    
    sql = 'delete from %s where id in (select id from pidata order by id limit 10)' % table_name
    sql = 'PRAGMA auto_vacuum=1'
    print sql
    
    c.execute(sql)  
    conn.commit() 

